<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>路由</title>
		<script type="text/javascript" src="../js/angular.min.js" ></script>
		<script type="text/javascript" src="../js/angular-route.min.js" ></script>
	</head>
	<body ng-app="myapp">
		<div>
			<h1>head</h1>
			<ul>
				<li><a href="#/index">首页</a></li>
				<li><a href="#/java">JAVAEE</a></li>
				<li><a href="#/ui">UI</a></li>
			</ul>
		</div>
		<div ng-view></div>
		<div>
			<h1>foot</h1>
		</div>
		
		<script type="text/javascript">
			//初始化
			var app = angular.module('myapp', ['ngRoute']);
			app.config(["$routeProvider",function($routeProvider){
				$routeProvider
				.when("/index",{
					templateUrl:'5-1.html'
				})
				.when("/java",{
					templateUrl:'5-2.html'
				})
				.when("/ui",{
					templateUrl:'5-3.html'
				});
			}]);
			
		</script>
	</body>
</html>
